<form method="post" class="tl_form" action="typolight/main.php?do=orderlist">
<div class="tl_formbody">
<input type="hidden" value="tl_filters" name="FORM_SUBMIT">

<div class="tl_panel">

<div class="tl_submit_panel tl_subpanel">
<input type="image" value="apply changes" title="Apply" class="tl_img_submit" src="system/themes/default/images/reload.gif" id="filter" name="filter_show">
</div>

<div class="tl_limit tl_subpanel">
<strong>Show:</strong>
<select class="tl_select active" name="tl_limit">
  <option value="">Records</option>
  <?php if ($this->orderCnt > 30): ?>
  <?php 
	$intQuotient = floor($this->orderCnt / 30);
	$intResidue = $this->orderCnt % 30;
	//print_r($this->limitValue);exit;
  ?>
  <?php for ($i = 0;$i < $intQuotient; $i++): ?>
  <option<?php if ($this->limitValue == ($i*30) . "," . ($i+1)*30): ?> selected="selected"<?php endif; ?> value="<?php echo $i*30; ?>,<?php echo ($i+1)*30; ?>"><?php echo $i*30+1; ?> - <?php echo ($i+1)*30; ?></option>
  <?php endfor; ?>
  <option<?php if ($this->limitValue == $i*30 . "," . $intResidue): ?> selected="selected"<?php endif; ?> value="<?php echo $i*30; ?>,<?php echo $intResidue; ?>"><?php echo $i*30+1; ?> - <?php echo $i*30+$intResidue; ?></option>
  <?php else: ?>
  <option selected="selected" value="0,30">1 - 30</option>
  <?php endif; ?>
  <option<?php if ($this->limitValue == "all"): ?> selected="selected"<?php endif; ?> value="all">All</option>
</select> 
</div>

<div class="tl_search tl_subpanel">
<strong>Order Status:</strong>
<select class="tl_select" name="tl_order_status" style="width:90px;">
  <option value=""></option>
  <option value="1"<?php if ($this->odr_status == "1"): ?> selected="selected"<?php endif; ?>>Accepted</option>
  <option value="2"<?php if ($this->odr_status == "2"): ?> selected="selected"<?php endif; ?>>In progress</option>
  <option value="3"<?php if ($this->odr_status == "3"): ?> selected="selected"<?php endif; ?>>Shipping</option>
  <option value="4"<?php if ($this->odr_status == "4"): ?> selected="selected"<?php endif; ?>>Delivered</option>
  <option value="6"<?php if ($this->odr_status == "6"): ?> selected="selected"<?php endif; ?>>Cancelled</option>
</select>

<strong>Search:</strong>
<select class="tl_select" name="tl_order_search">
  <option value="orderno"<?php if ($this->order_search == "orderno"): ?> selected="selected"<?php endif; ?>>Order Number</option>
  <option value="id_member"<?php if ($this->order_search == "id_member"): ?> selected="selected"<?php endif; ?>>Email or First Name</option>
</select>
<span>=</span>
<input type="text" value="<?php echo $this->search_value; ?>" class="tl_text" name="tl_search_value">
</div>

<div class="clear"></div>

<div id="tl_buttons">
<a onclick="Backend.getScrollOffset();" title="Export orders by id" class="header_css_export_id" href="typolight/main.php?do=order&amp;key=export_id">Export by order number</a><!--  &nbsp; :: &nbsp; <a onclick="Backend.getScrollOffset();" title="Export orders by skuid" class="header_css_export_skuid" href="typolight/main.php?do=order&amp;key=export_skuid">Export by skuid</a>-->
</div>

</div>
</div>
</form>

<div class="tl_listing_container">
	<table cellspacing="0" cellpadding="0" summary="Table lists records" class="tl_listing">
		<tbody>
			<?php if ($this->orders): ?>
			<?php $arrKeys = array_keys($this->orders[0]); ?>
			<tr>
			<?php foreach ($arrKeys as $key=>$strKey): ?>	
			<?php if ($key == 0):  continue; endif; ?>
				<th style="padding-left:6px;" align="left"><?php echo $GLOBALS['TL_LANG']['tl_ordrelist'][$strKey]; ?></th>			
			<?php endforeach; ?>
			</tr>
			<?php foreach ($this->orders as $key=>$arrOrder): ?>
			<tr>
				<!-- oder number -->
				<td class="tl_folder_tlist"><?php echo $arrOrder['orderno']; ?></td>
				<td class="tl_folder_tlist"><?php echo $arrOrder['memberName']; ?></td>
				<td class="tl_folder_tlist"><?php echo $arrOrder['date_add']; ?></td>
				<td class="tl_folder_tlist"><?php echo $arrOrder['total_paid_real']; ?></td>
				<td class="tl_folder_tlist"<?php if ($arrOrder['status'] == 'Cancelled'): ?> style="Color:Red;"<?php endif; ?>><?php echo $arrOrder['status']; ?></td>
				<td><a href="typolight/main.php?do=orderlist&act=detail&id=<?php echo $arrOrder['id']; ?>" title="order detail"><img width="12" height="16" alt="Edit order text" src="system/themes/default/images/edit.gif"></a></td>
				<td><a onclick="if (!confirm('Do you really want to delete entry ID <?php echo $arrOrder['id']; ?>?')) return false; Backend.getScrollOffset();" title="Delete order text ID <?php echo $arrOrder['id']; ?>" href="typolight/main.php?do=orderlist&amp;act=delete&amp;id=<?php echo $arrOrder['id']; ?>"><img width="14" height="16" alt="Delete order text" src="system/themes/default/images/delete.gif"></a></td>
				<!--<td><a title="Show details of ticker text ID <?php echo $arrOrder['id']; ?>" href="typolight/main.php?do=orderlist&amp;act=show&amp;id=<?php echo $arrOrder['id']; ?>"><img width="16" height="16" alt="Show ticker text" src="system/themes/default/images/show.gif"></a></td>
			</tr>-->
			<?php endforeach;endif; ?>
		</tbody>
	</table>
</div>